﻿
@{
    ViewBag.Title = "修改首页菜单";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using Mate.Framework.Extensions
@model Mate.Db.Model.Info.mp_app_home_menu
@section styles{
    <link href="~/bootstrap/plugins/jquery-file-upload/css/jquery.fileupload.css" rel="stylesheet" />
}
@section scripts{
    <script src="~/bootstrap/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/bootstrap/plugins/jquery-validation/dist/additional-methods.min.js"></script>
    <script src="~/bootstrap/scripts/custom/form-validation.js" charset="gbk"></script>

    <script src="~/bootstrap/plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js"></script>
    <script src="~/bootstrap/plugins/jquery-file-upload/js/jquery.fileupload.js"></script>
    <script src="~/bootstrap/scripts/custom/form-fileupload.js"></script>

    <script src="~/js/admin.js?v=1.0"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            var rules = {
                menu_name: {
                    required: true
                },
                menu_icon: {
                    required: true
                },
                link_url: {
                    required: true
                },
                sort_id: {
                    required: true,
                    digits: true
                }
            };
            FormValidation.BasicValidation(rules);

        });
        @Html.UploadPictureJs("menu_icon");
    </script>
}

<ul class="page-breadcrumb breadcrumb">
    <li>
        <a href="@Url.Action("Index","AppHomeMenu")">
            首页菜单管理
        </a>
        <i class="fa fa-angle-right"></i>
    </li>
    <li>
        修改首页菜单
    </li>
</ul>

<div class="row">
    <div class="col-md-12">

        <div class="portlet-body form">
            <!-- BEGIN FORM-->
            @using (Html.BeginForm("Edit", "AppHomeMenu", FormMethod.Post, new { @class = "form-horizontal", @id = "form_ff_validation", @novalidate = "novalidate" }))
            {
                <div class="form-body">

                    @Html.TextFor("菜单名称", "menu_name", value: Model.menu_name)
                    @Html.UploadPictureFor("图标", "menu_icon", picSrc: Model.menu_icon)

                    @Html.RadioFor("是否外链", "isframe", new List<KeyValuePair<string, string>>()
                                                       {
                                                           new KeyValuePair<string, string>("0","内链"),
                                                           new KeyValuePair<string, string>("1","外链")
                                                       },selectValue:Model.isframe.ToString())
                    @Html.TextFor("链接地址", "link_url", value: Model.link_url)

                    @Html.TextFor("排序", "sort_id", value: Model.sort_id.ToString())
                    @Html.RadioFor("状态", "is_open", new List<KeyValuePair<string, string>>()
                                                       {
                                                           new KeyValuePair<string, string>("1","启用"),
                                                           new KeyValuePair<string, string>("2","禁用")
                                                       },selectValue:Model.is_open.ToString())
                </div>

                <div class="form-actions fluid">
                    <div class="col-md-offset-3 col-md-9">
                        @Html.HiddenFor(x=>x.id)
                        <button class="btn green" type="button" onclick="admin.AddSubmit('@Url.Action("Index")')"> 提交 <i class="fa fa-check"></i> </button>
                        <a class="btn default" role="button" href="@Url.Action("Index")"> 返回 <i class="fa fa-reply"></i></a>
                    </div>
                </div>
            }
            <!-- END FORM-->
        </div>
    </div>
    <!-- END VALIDATION STATES-->
</div>
